import java.util.Scanner;

/**
 * @author vivi
 * @description
 * @date 2024/4/18
 */
public class Test {

    public static void main (String[] args) {
        //杨辉三角
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int[][] str = new int[n][n];

        for (int j = 0; j < n; j++) {
            for (int i = 0; i <= j; i++) {
                if(i == 0 || i == j){
                    str[j][i] = 1;
                }else {
                    str[j][i] = str[j-1][i-1] + str[j-1][i];
                }
            }
        }

        for(int i=0;i<n;i++){
            for(int j=0;j<=i;j++){
                System.out.print(String.format("%5d",str[i][j]));
            }
            System.out.println();
        }
    }

    public static void main1 (String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int f1 = 0;
        int f2 = 1;
        int f3 = f1 + f2;

        while(true){
            if(f2 == n){
                System.out.println(0);
            } else if (f2 > n) {
                if (Math.abs(f2 - n) > Math.abs(f1 - n)) {
                    System.out.println(Math.abs(f1-n));
                } else {
                    System.out.println(Math.abs(f2-n));
                }
                break;
            }
            f1 = f2;
            f2 = f3;
            f3 = f1 + f2;
        }

    }
}
